<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>过渡</title>
  <style>
    body {
      margin: 0;
      padding: 0;
    }

    #app {
      width: 400px;
      height: 400px;
      /*居中*/
      margin: auto;
      background-color: #6695cf;
      transition: background-color 3s ease-in, width 3s ease-out 3s;
    }

    #app:hover {
      background-color: pink;
      width: 200px;
    }
  </style>
</head>

<body>
  <div id="app">

  </div>
</body>

</html>